import request from '@/utils/request'

// 查询函数信息列表
export function listDatasql(query) {
  return request({
    url: '/reportworld/datasql/list',
    method: 'get',
    params: query
  })
}

// 查询函数信息详细
export function getDatasql(data) {
  return request({
    url: '/reportworld/datasql/getInfo',
    method: 'post',
    data: data
  })
}

// 新增函数信息
export function addDatasql(data) {
  return request({
    url: '/reportworld/datasql',
    method: 'post',
    data: data
  })
}

// 修改函数信息
export function updateDatasql(data) {
  return request({
    url: '/reportworld/datasql',
    method: 'put',
    data: data
  })
}

// 删除函数信息
export function delDatasql(idList, hisVersion) {
  const data = {
    idList,
    hisVersion
  };
  return request({
    url: '/reportworld/datasql/remove',
    method: 'post',
    data: data
  })
}

// 初始化查询
export function init(data) {
  return request({
    url: '/reportworld/datasql/init',
    method: 'post',
    data: data
  })
}
